import { triplitClient } from "@renderer/client";
import type { BaseQueries } from "../types";

/**
 * Standard query definitions for the `threadForms` collection
 */
export const threadFormsQueries: BaseQueries<"threadForms"> & {
  /** Get `threadForms` by threadId */
  byThreadId: (
    threadId: string,
  ) => ReturnType<typeof triplitClient.query<"threadForms">>;
} = {
  /**
   * Get all `threadForms` records
   */
  all: () => triplitClient.query("threadForms"),

  /**
   * Get a single `threadForms` record by ID
   */
  byId: (id: string) => triplitClient.query("threadForms").Id(id),

  /**
   * Get `threadForms` by threadId
   */
  byThreadId: (threadId: string) =>
    triplitClient.query("threadForms").Where("threadId", "=", threadId),
} as const;
